<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of user
 *
 * @author agasi
 */
class User extends CI_Controller {
    
    function __construct() 
    {
        parent::__construct();
        $this->load->helper('flexigrid');
//        $this->load->model('user_model');
//        $this->output->enable_profiler(TRUE);
    }
    
    function index()
    {
        //ver lib
		
        /*
            * 0 - display name
            * 1 - width
            * 2 - sortable
            * 3 - align
            * 4 - searchable (2 -> yes and default, 1 -> yes, 0 -> no.)
            */

        $colModel['user_id'] = array('ID',40,TRUE,'center',2);
        $colModel['user_nama'] = array('ISO',40,TRUE,'center',0);
        $colModel['user_real_nama'] = array('Name',180,TRUE,'left',1);
        $colModel['user_email'] = array('Printable Name',120,TRUE,'left',0);
        $colModel['user_status'] = array('ISO3',130, TRUE,'left',0);
//		$colModel['numcode'] = array('Number Code',80, TRUE, 'right',1);
        $colModel['actions'] = array('Actions',80, FALSE, 'right',0);


        /*
            * Aditional Parameters
            */
        $gridParams = array(
        'width' => 700,
        'height' => 400,
        'rp' => 15,
        'rpOptions' => '[10,15,20,25,40]',
        'pagestat' => 'Displaying: {from} to {to} of {total} items.',
        'blockOpacity' => 0.5,
        'title' => 'User',
        'usepager'=> true,
        'useRp' => true,
        'showTableToggleBtn' => true,
        );

        /*
            * 0 - display name
            * 1 - bclass
            * 2 - onpress
            */
        $buttons[] = array('Delete','delete','test');
        $buttons[] = array('separator');
        $buttons[] = array('Select All','add','test');
        $buttons[] = array('DeSelect All','delete','test');
        $buttons[] = array('separator');


        //Build js
        //View helpers/flexigrid_helper.php for more information about the params on this function
        $grid_js = build_grid_js('flex1',site_url("/sistem/user_ajax"),$colModel,'user_id','asc',$gridParams,$buttons);

        $data['js_grid'] = $grid_js;
//        $data['menu'] = $this->menu_model->get_menu(1);
//		$data['version'] = "0.36";
//		$data['download_file'] = "Flexigrid_CI_v0.36.rar";
        //echo '<textarea>'.$grid_js.'</textarea>';
//		$this->load->view('header');
//                $this->load->view('sidebar',$data);
        $this->load->view('/sistem/user_view',$data);
    }
    
    function user_add()
    {
        $this->load->view('/sistem/user/add');
    }
}

/* End of file user.php */
/* Location: ./application/controllers/sistem/user.php */